package br.enovar.com;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class HibernateUtil {
	private static SessionFactory factory;
	
	static{
		Configuration configuration = new Configuration().configure("/hibernate.cfg.xml");
		configuration.addAnnotatedClass(Funcionario.class);
		factory = configuration.buildSessionFactory();
	}
	
	public static Session getSession(){
		return factory.openSession();
	}
}
